function getData(page){
    var POSTURL;
    if (!isNaN(page)){
        POSTURL ='/article/article-square/?page='+page;
    }else{
        POSTURL = '/article/article-square/';
    }
    $.ajax({
    url: POSTURL,
    type: 'POST',
    success: function (resp) {
        for (var i = 0; i < resp.data.length; i++) {
            var $box = $('<div class="box"></div>');
            var helper=resp.data[i].content.split('#').join('').split('/n').join('');
            var content;
            if (helper.length > 35) {
                content = helper.slice(0, 35) + '...';
            } else {
                content = helper;
            }
            var title = resp.data[i].title;
            var author = resp.data[i].UserName;
            var itemBox1 = $('<div class="media"></div>');
            var itemBox2 = $('<div class="media-content"></div>');
            var itemBox3 = $('<div class="content"></div>');
            var item1 = '<a href="/article/show_article/?a_id=' + resp.data[i].id + '"><p><strong id="a_title" style="font-size: 24px;font-weight: bolder;">' + title + '</strong></p></a>';
            var item2 = '<p id="content" style="font-size: 18px">' + author + ':' + content + '</p>';
            var item3 = '<p> <a class="tag is-medium is-lightblue has-addons"> <i class="fa fa-caret-up"></i> <span class="icon is-large" style="width: fit-content">赞同 '+resp.data[i].LikeCount+'</span> </a> <a class="tag is-medium is-lightblue"> <i class="fa fa-caret-down"></i> </a> <a href="#" class="ml-10"> <i class="fa fa-comment"></i> <span id="commentsNum">'+resp.data[i].CommentCount+' 条评论</span> </a></p>';
            itemBox3.append(item1, item2, item3);
            itemBox2.append(itemBox3);
            itemBox1.append(itemBox2);
            $box.append(itemBox1);
            $('nav').before($box);
        }},
    });
}
